package com.job.controller;

import com.job.pojo.Check;
import com.job.pojo.Money;
import com.job.pojo.Offer;
import com.job.service.OfferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;

@Controller
@RequestMapping("/offer")
public class OfferController {
    @Autowired
    OfferService offerService;

    @RequestMapping("/selectAjax")
    @ResponseBody
    public HashMap<String,Object>select(Offer offer)
    {
        return offerService.select(offer);
    }


    //查询时间
    @RequestMapping("/time")
    @ResponseBody
    public List<Offer> time(){
        return offerService.time();
    }

    //处理修改的ajax
    @RequestMapping("/updateAjax")
    @ResponseBody
    public HashMap<String,Object> updateMoney(Offer offer)
    {
        HashMap<String,Object> map = new HashMap<String,Object>();
        String info=offerService.update(offer);
        map.put("info",info);
        return map;
    }

    //处理增加的ajax
    @RequestMapping("/addAjax")
    @ResponseBody
    public HashMap<String,Object>add(Offer offer)
    {
        HashMap<String,Object> map =new HashMap<>();
        String info=offerService.add(offer);
        map.put("info",info);
        return map;
    }
    //处理删除的ajax
    @RequestMapping("/delAjax")
    @ResponseBody
    public HashMap<String,Object>delUser(Offer offer)
    {
        HashMap<String,Object> map =new HashMap<>();
        String info=offerService.del(offer);
        map.put("info",info);
        return map;
    }

    //查询pass
    @RequestMapping("/passAjax")
    @ResponseBody
    public List<Offer>pass(Offer offer)
    {
        return offerService.pass(offer);
    }


}
